package mysql

import "gorm.io/gorm"

type Plan struct {
	gorm.Model
	UserId      int     `gorm:"type:int(10);not null;comment:'用户id'"`
	CouRseId    int     `gorm:"type:int(10);not null;comment:'课程id'"`
	CouRseName  string  `gorm:"type:varchar(50);not null;comment:'课程名称'"`
	CouRsePrice float64 `gorm:"type:double(10,2);not null;comment:'课程价格'"`
	CouResInter string  `gorm:"type:varchar(255);not null;comment:'课程介绍'"`
}

func CreatePlan(plan *Plan) error {
	return DB.Debug().Create(&plan).Error
}
func PlanDel(id int) error {
	return DB.Debug().Where("id = ?", id).Delete(&Plan{}).Error
}
